/*  BEGIN_FILE_HDR
******************************************Copyright(C)*****************************************
*
*                                       YKXH  Technology
*
***********************************File Info***************************************************
*   File Name       @:PduR_Types.h
************************************************************************************************
*   Project/Product @: PduR
*   Title           @: 
*   Author          @: zhongliang.Yang 
************************************************************************************************
*   Description     @: 
*                   
************************************************************************************************
*   Limitations     @: None
*
************************************************************************************************
*
************************************************************************************************
*   Revision History:
* 
*   Version     Date          Initials           CR#         Descriptions
*   --------    -----------   ----------------   --------    -----------------------
*   1.0         2018/05/29    zhongliang.yang    N/A         Original 
*   1.1         xxxx/xx/xx    xxxxx              N/A         xxxxxxxx 
*     
************************************************************************************************
* END_FILE_HDR*/

#ifndef _PduR_Types_h_
#define _PduR_Types_h_

#include "../src/BSW/CommS/NM/YKBase/BaseComm.h"

/**/
#define ToCanIfRef     1u
#define ToCanTpRef     2u
#define ToLinIfRef     3u
#define ToLinTpRef     4u
#define ToFrIfRef      5u
#define ToFrTpRef      6u
#define ToComRef       7u
#define ToDcmRef       8u

#define FromCanIfRef   1u
#define FromCanTpRef   2u
#define FromLinIfRef   3u
#define FromLinTpRef   4u
#define FromFrIfRef    5u
#define FromFrTpRef    6u
#define FromComRef     7u
#define FromDcmRef     8u





typedef uint8 PduR_PBConfigIdType;
typedef int   PduR_RoutingTableIdType;


typedef enum
{
    PDUR_UNINIT   = 0,
    PDUR_ONLINE   = 1,
    PDUR_REDUCED  = 2
} PduR_StateType;

typedef Std_ReturnType PduR_ReturnType;

typedef uint16 PduRTpThreshold_Tpye; 
typedef uint8* PduRDestTxBufferPtr; 

typedef uint8 PeuRRouting_Type;

#define SingleCast    0x01
#define MultipCast    0x02
#define UnDefined     0xff

#define PDUR_TRANSMISSION_CONFIRMATION    STD_ON
#define PDUR_TRANSMISSION_CONFIRMATION    STD_ON

typedef enum
{
    PDUR_DIRECT = 1,
    PDUR_TRIGGERTRANSMIT = 2
}Routing_Tpye;

typedef uint8  gPduRHandleType;
typedef uint8  PduIdDirType;




typedef struct{

  gPduRHandleType      PduRHandle;

}PduRBswModulesType;   

typedef struct
{
    uint8              PduRDefaultValueElementElement;
    uint8              PduRDefaultValueElementBytePosition;
   
}PduRDefaultValueElementType;


typedef struct
{
    PduIdDirType                  PduRDestPduRef;
    uint8                         PduRDestPduDataProvision;
/*
    uint16                        PduRTpThreshold;       
    PduRDestTxBufferPtr           PduRDestTxBufferRef;
    PduRDefaultValueElementType   PduRDefaultValueElement;
*/
    PduIdType                     PduRDestPduHandleId;
    boolean                       PduRTransmissionConfirmation;
   
}PduRDestPdu_Type;


typedef struct
{
    uint16               PduRMaxTpBufferNumber;
    uint16               PduRTpBufferLength;
}PduRTpBufferTable_Type;



typedef enum{
 DEFFERED,
 IMMEDIATE,
}PduRBufferFIFOType;

/* for If GW  */
typedef struct
{
    uint16               PduRMaxTxBufferNumber;
    uint8                PduRBufferLength;
    uint8                PduRBufferDepth;
    PduRBufferFIFOType   PduRBufferFIFO;            

}PduRTxBufferTable_Type;





typedef struct
{
    PduIdType                  PduRSrcPduHandleId;
    PduIdDirType               PduRSrcPduRef;
}PduRSrcPdu_Type;





typedef struct{
 //uint8        PduDir;
 uint16   const PduRDestPduIndex;

 uint16   const PduRSrcPduIndex;

 //PduRSrcPdu_Type   PduRSrcPduHanlde;
 //PduIdType         PduRSrcPduHanlde;
}PduRRoutingPath_Type;

typedef struct{
 uint8      ConfCnt;
 //PduIdType  CurrentComHandle;
}ComTxConfCnt_Type;

typedef struct{
 uint8             PduRIsEnabledAtInit;
 uint16            PduRRoutingPathGroupId;
 PduRDestPdu_Type const* PduRDestPduRef;
}PduRRoutingPathGroup_Type;


typedef struct{
uint8  NumOfRelatedHanldId;
}relatedComHanldId;

typedef struct{
  PduIdType    gPduHandle;
  PduIdDirType UpperLayer;
}CanIfConfMapping;


typedef struct{
  PduIdType    UpperHandle;
  PduIdDirType UpperLayer;
}CanTpConfMapping;

typedef struct{
  PduIdType    RxMappingIndex;
  PduIdDirType UpperLayer;
}CanTpIndMapping; 
 

typedef struct{
  PduRRoutingPath_Type  PduRRoutingPath; 
}PduRRoutingTable;


typedef struct{
  uint8                               NumOfDest;
  const PduRRoutingTable*             PduRTablePtr;
}PduRRoutingTableIndexType;

typedef struct{
  const PduRRoutingTableIndexType*  PduRComRoutingTableIndexPtr;
  const PduRRoutingTableIndexType*  PduRDcmRoutingTableIndexPtr;
  const PduRRoutingTableIndexType*  PduRCanIfRoutingTableIndexPtr;
  const PduRRoutingTableIndexType*  PduRCanTpRoutingTableIndexPtr;
  uint8*                            PduRComRoutPathDestCntPtr;
  uint8*                            PduRDcmRoutPathDestCntPtr;
  uint8*                            PduRCanIfRoutPathDestCntPtr;
  uint8*                            PduRCanTpRoutPathDestCntPtr;
}PduR_PBConfigType;

#endif
